package com.czy.owner.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.TextView;

import com.czy.owner.R;
import com.czy.owner.entity.ScopeBusinessModel;

import java.util.ArrayList;
import java.util.List;


/**
 * Created by hedepu on 2017/10/9
 */

public class ScopeBusinessSelectAdapter extends BaseRecyclerAdapter<ScopeBusinessModel.ScopeBusinessModelBean, ScopeBusinessSelectAdapter.ScopeBusinessSelectHolder> {
    private Context ctx;
    private ArrayList<ScopeBusinessModel.ScopeBusinessModelBean> selectData = new ArrayList<>();



    public ScopeBusinessSelectAdapter(Context context, List<ScopeBusinessModel.ScopeBusinessModelBean> data) {
        super(context, data);
        this.ctx = context;

    }


    @Override
    public void onBindViewHolder(ScopeBusinessSelectHolder holder, int position) {
        super.onBindViewHolder(holder, position);
        holder.bindData(position);


    }

    @Override
    public ScopeBusinessSelectHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        return new ScopeBusinessSelectHolder(layoutInflater.inflate(R.layout.item_subscribe_service_sub, parent, false));
//        return null;
    }

    public class ScopeBusinessSelectHolder extends BaseRecyclerAdapter.ViewHolder {
        private TextView cbItemServiceName;

        public ScopeBusinessSelectHolder(View itemView) {
            super(itemView);
            cbItemServiceName = (TextView) itemView.findViewById(R.id.cb_item_service_name_sub);
        }

        public void bindData(int position) {
            cbItemServiceName.setText(data.get(position).getServiceName());

        }
    }

}